/*
 * @Description: 该文件描述
 * @FilePath: \app_template\apps\app\src\utils\env.ts
 * @Author: Brian Brian@gmail.com
 * @Date: 2024-08-13 14:34:34
 * @LastEditors: Brian Brian@gmail.com
 * @LastEditTime: 2024-09-09 18:07:38
 */
/**
 * @des 获取环境变量
 */
function isEnv(): Env;
function isEnv(mode: Env): boolean;
function isEnv(param: any = "") {
  const MODE = import.meta.env.MODE;
  if (!param) {
    return MODE;
  }
  if (param === MODE) return true;
  return false;
}

export { isEnv };

/**
 * @des 判断本地环境
 * @returns
 */
export const isLocale = () => {
  const url = window.location.href;
  return (
    url.includes("192.168") ||
    url.includes("127.0.0.1") ||
    url.includes("localhost")
  );
};
